<?php
/**
 * Author: Zheng_Great
 * Date: 2019-06-07 08:26:08
 * Description: 所有服务基础方法  
 */

namespace common\services;


class BaseService {
    
    protected static $_error_msg = null;
    protected static $_error_code = null;
    
    // 操作失败提示
    public static function _err($msg='',$code = -1){
        if($msg){
            self::$_error_msg = $msg;
        }else{
            self::$_error_msg = '操作失败';
        }
        self::$_error_code = $code;
        return false;
    }

    // 错误提示
    public static function getLastErrorMsg(){
        return self::$_error_msg?self::$_error_msg:"";
    }

    // 错误代码
    public static function getLastErrorCode(){
        return self::$_error_code?self::$_error_code:0;
    }
}